function [A,Q] = UpdateA(U, X, V, Q, alpha, c)
% Update A 
%dictsize=k;

AA = U' * U;
invQ = 1./Q;
BB = alpha * diag(invQ);
XQ = bsxfun(@times, X, invQ);
CC = -alpha*V'*XQ-U'*X;

A = lyap(AA, BB, CC);
r = X-U*A;
Q = 1 ./ (c^2 + sum(r .* r,1)+eps);
end



